<template>
  <component :is="comp.tabs" :push="val" />
</template>
<script>
import { QqPlot, GroupAccess, Monster, ChartRadar } from "@vicons/carbon";

import { cfg } from "@/cfg/cfg.js";
export default defineComponent({
  setup() {
    if (cfg.route.query.type2 == null) {
      cfg.router.push({
        query: {
          ...cfg.route.query,
          type2: "stat",
        },
      });
    }
    const comp = {
      tabs: defineAsyncComponent(() => import(`@/comp/nav_tabs.vue`)),
      stat: defineAsyncComponent(() => import(`./guild_v2/stat.vue`)),
      chart: defineAsyncComponent(() => import(`./guild_v2/chart.vue`)),
      report: defineAsyncComponent(() => import(`./guild_v2/report.vue`)),
      dx: defineAsyncComponent(() => import(`./guild_v2/dx.vue`)),
      admin: defineAsyncComponent(() => import(`./guild_v2/admin.vue`)),
    };

    let val = {
      tab: [
        {
          icon: GroupAccess,
          comp: comp.stat,
          title: `公会总览`,
          ck: `stat`,
        },
        {
          icon: Monster,
          comp: comp.report,
          title: `战斗记录`,
          ck: `battle_record`,
        },
        {
          icon: QqPlot,
          comp: comp.chart,
          title: `数据图表`,
          ck: `data_chart`,
        },
        {
          icon: ChartRadar,
          comp: comp.dx,
          title: `公会刀型`,
          ck: `dx`,
        },
        {
          icon: ChartRadar,
          comp: comp.admin,
          title: `公会管理`,
          ck: `admin`,
        },
      ],
    };

    return {
      comp,
      val,
    };
  },
});
</script>
